package com.ncut.api.client;

import com.ncut.entity.Setmeal;
import com.ncut.result.Result;
import com.ncut.vo.DishVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @FileName ProductClient
 * @Description
 * @Author Sword
 * @date 2025-08-07
 **/

@FeignClient("product-service")
public interface ProductClient {

    /**
     * 根据dishId查询菜品
     *
     * @param id
     * @return
     */
    @GetMapping("/user/dish/{id}")
    Result<DishVO> getByDishId(@PathVariable Long id);

    /**
     * 根据setmealId查询套餐
     *
     * @param id
     * @return
     */
    @GetMapping("/user/setmeal/{id}")
    Result<Setmeal> getBySetmealId(@PathVariable Long id);

    /**
     * 统计套餐启售停售数量
     *
     * @param map
     * @return
     */
    @GetMapping("/admin/setmeal/count")
    Integer setmealCountByMap(@RequestParam Map<String, Object> map);

    /**
     * 查询菜品总览
     *
     * @param map
     * @return
     */
    @GetMapping("/admin/dish/count")
    Integer dishCountByMap(@RequestParam Map<String, Object> map);

}
